package com.dhecp.project.storage.mapper;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.dhecp.core.genericDao.GenericDao;
import com.dhecp.project.storage.domain.DeliveryLogisticsDetail;

/**
 * DAO
 * @author Jason
 */
public interface DeliveryLogisticsDetailMapper extends GenericDao<DeliveryLogisticsDetail, String>  {

	/**
     * 查询实体
     * @author Jason
	 */
	List<DeliveryLogisticsDetail> select(Map<String, Object> params);

	/**
     * 查询实体
     * @author Jason
	 */
	List<DeliveryLogisticsDetail> listByBidLogistics(@Param("bidLogistics")String bidLogistics);

	/**
	 * 新增实体
	 * @author Jason
	 */
	int insertDeliveryLogisticsDetail(DeliveryLogisticsDetail entity);

	/**
	 * 通过bid删除
	 * @author Jason
	 */
	int deleteByBidLogistics(@Param("bidLogistics")String bidLogistics);

    /**
     * 查找物流发货单中商品的发货数量
     */
    BigDecimal sumByBidAndProductCode(@Param("bidLogistics")String bidLogistics, @Param("productCode")String productCode);
    
    /**
     * 查找目的地仓库的商品发货中数量
     */
    BigDecimal sumProcessByWarehouseAndProductCode(@Param("warehouse")String warehouse, @Param("productCode")String productCode);

}
